package util;

import java.util.List;

/**
 * 与前端DataTable插件对接的接口
 * Created by BaiYunfei on 2017/6/11.
 */
public class DataTable {

    private int draw; // 客户端请求的次数
    private int recordsTotal; // 总记录数
    private int recordsFiltered; // 根据条件过滤后的记录数
    private List data; // 数据

    public DataTable(int draw, int recordsTotal, int recordsFiltered, List data) {
        this.draw = draw;
        this.recordsTotal = recordsTotal;
        this.recordsFiltered = recordsFiltered;
        this.data = data;
    }

    public DataTable(int recordsTotal, List data) {
        this.draw = 1;
        this.recordsTotal = recordsTotal;
        this.recordsFiltered = recordsTotal;
        this.data = data;
    }

    public DataTable() {
    }

    public int getDraw() {
        return draw;
    }

    public void setDraw(int draw) {
        this.draw = draw;
    }

    public int getRecordsTotal() {
        return recordsTotal;
    }

    public void setRecordsTotal(int recordsTotal) {
        this.recordsTotal = recordsTotal;
    }

    public int getRecordsFiltered() {
        return recordsFiltered;
    }

    public void setRecordsFiltered(int recordsFiltered) {
        this.recordsFiltered = recordsFiltered;
    }

    public List getData() {
        return data;
    }

    public void setData(List data) {
        this.data = data;
    }
}
